import java.lang.reflect.Array;
import java.util.Arrays;

public class Test {
    public static boolean func(int[] array) {//判断数列中是否有连续的三个奇数
        int count = 0;
        for (int i = 0;i < array.length;i++){
            if (array[i] % 2 != 0){
                count++;
                if (count == 3){
                    return true;
                }
            }else {
                count = 0;
            }
        }
        return false;
    }
    public static int moreNum(int[] array) {//返回一组数列中出现次数超过n/2的数
        Arrays.sort(array);
        return array[array.length/2];
    }

    public static int moreNum2(int[] array) {
        int count = 0;
        int tmp = array[0];
        for (int i = 0;i<array.length;i++){
            if (count == 0) {
                tmp = array[i];
                count++;
            }else if (array[i] == tmp){
                count++;
            }else if (array[i] != tmp){
                count--;
            }
        }
        return tmp;
    }
}
